move getMsgType to message parser.