refactor chapters