implemented MessageDispatcher class