Clean code, replace if with switch