splitting lib.hpp into separate include files + some cleanups