Convert two if sequences to switches.