Replaced if... else with switch in Var if possible.