Refactoring to remove unecessary queueing of messages and better reasoning about code.