refactor lab 7