Refactoring message into a module