if else to Switch