nicer code in function SwitchItems