Made better use of the message type flag.