Code from the book Refactoring, Ruby Edition