Switched if-else for switch-case