Event handling guts