move module to lib ready for unit test