moving classes to lib