moved main module to lib directory