a) change the protocol
b) add message reader and writer to separate the functionality