moving into lib
moving to lib + renaming a few things for clarity