refactoring, also adjusted so multiple joysticks may be used, in prep for touch support