Convert to use batch processing