Rewrote some of EventManager as to be more in the functional style