Creating tasks in batches