Moved function from case_model to task_model