class refactoring