refactoring class