[util] Refactor batch-processing code into batch.hh
6 files changed