refactor batch_processor