Batch processing template code