Improved event handlers.