Improved the EventManager to allow for faster event handling.