Better event handling.