Improve event handling.