refactoring step 3