Refactoring messaging