moved script into class