a little golfing of event-handler