Refactoring. Module pattern