Refactoring for module implementation