Refactoring module directive for messages