moves lib to its own file