Refactored Message class in a separate file