refactored get_task_data for the sake of clearness