put code into class