Event handler improvements