An exercise to practice refactoring