Refactor chapters