small refactor to chunking to bulkdocs