Refactoring to create an exercise