finish refactoring modules