Refactor main html document into a separate document per section