refactoring chapter 1 for 2.0