implement parseMessage method