Batch processing refactoring.