made MessageParser code slightly less awful