Some refactoring in joystick