Removed trailing whitespace
Refactored parseMessage to be much simpler