Fixing use
Performance and updating to latest changes

Removing double-dispatch from MessageFactory and using a switch.