Separated messageHandler functionality into messageProcessor