Making parser to encode and decode message