Refactor sending of messages to observers