Switch from if/else to switch