finished refactoring Modules
completed refactoring logic