relay: switch to switch statements