Refactoring chapter1 example