public function isValid($value, $checkExistence = false)
    {
        if (null === $value || '' === $value) {
            return false;
        }

        $countryCode = substr($value, 0, 2);
        $vatin = substr($value, 2);

        if (false === $this->isValidCountryCode($countryCode)) {
            return false;
        }

        if (0 === preg_match('/^(?:'.$this->patterns[$countryCode].')$/', $vatin)) {
            return false;
        }

        if (true === $checkExistence) {
            $result = $this->getViesClient()->checkVat($countryCode, $vatin);

            return $result->isValid();
        }

        return true;
    }