private function getFactoryForType($taskType)
    {
        foreach ($this->factories as $factory) {
            if ($factory->isTypeSupported($taskType)) {
                return $factory;
            }
        }

        return null;
    }