Canonicalizing the order of tasks