Refactor MessageFormatter.