message refactoring