refactoring to implement Module Pattern