Added function to parse receive message type.
Refactor of message parsing: added a on-fly parsing!