Refactoring the message decoder.