Refactored how message processing happens a bit.