Improvements to event dispatching