Return a map of tasks - order doesn't matter.
Eliminated some duplication.