refactoring step 2