moved global variables into class in joyfly