Implemented message parsing functions.