Refactor/chapter7