Refactored read method of Message class