Refactor messages components.