Transforming into class and opening three files