"if" replaced by "switch"