Starting to move stuff in to a lib