If statement optimization in JoystickHandler