Move task creation and registration to `task/factory`