clean up
registerMessageHandler method