Use switch for event type handling