Global refactoring, part 3 (messages)