Refactoring design section in chapter 2