Use switch instead of if / else

Better I think. It reduces the code and makes it more logical.
Switch to 1.9.1