added caching of handlers for message types