How about using a `switch` statement on `event.type` here?