Agreed, if $vsite is returned then purl_provider should be set.  We can consolidate if's