improving flow of message parsing, better comments