refactor: separate concerns of encoding, encryption, and normal values in messages