Refactored Message class