Make event handling more consistent