Refactoring task from Martin Fowler's Refactoring book