Reduce messageHandler complexity.