[minor] Better event handling