replace task_factory with create_task() method