I'd prefer to have unit test for this function in task_manager_test