class refactoring step 2