Implemented the message dispatch mechanism