refactor to make a reusable Register.get_task_cls