step 8 refactor