private function getRootDomain($domain)
    {
        $domainParts = explode('.', $domain);
        $count       = count($domainParts);

        return $count > 1
            ? $domainParts[$count - 2].'.'.$domainParts[$count - 1]
            : $domainParts[0];
    }