refactor chapter