Remove unnecessary loop for iterating through tasks