module refactoring, fixing test