Generalized subtask logic, improved spawn/exec