Improved validation of received data
WIP: changing the messaging protocol