Refactoring to make job removal, stage removal, task cancellation clearer