Using switch instead of if.