Using pointer to tasks instead of vec to improve performance.