added boilerplate html to cleaned chapters. also refactoring