lecture 10 refactoring