major overhaul of message parsing