outsourced list_tasks and testing it