Messages refactoring