simplify logic flow of call_tasks