Refactoring for Module struct