refactoring messages