refactoring step 6