break switch-cases into if-else chains