Can you move this in to the switch as not handling a case is undefined behaviour