Java refactoring example by Martin Fowler