Refactoring, working with messages