refactoring step 4