An exercise in refactoring.