A refactoring exercise