Refactored Messages class to Message