Module refactoring