Refactor for AbstractMessage class for Encoder & Decoder.