add chapter 2
refactoring