changed some functions and deprecated messy implementation of
Protocol.Message