refactoring scheduled_task model