refectoring class