Can we refactor this _.each loop into:
```javascript
        var urlRegex = /'(.*)'/g;
        _.each(tenantVariables, function(value, key) {
            var variableMetadata = cachedSkinVariables[key];

            // Try to apply optimized paths if we're dealing with a URL.
            if (variableMetadata && variableMetadata.type === UIConstants.variables.types.URL && urlRegex.test(value)) {
                var url = value.replace(urlRegex, '$1').trim();
                if (hashes[url]) {
                    tenantVariables[key] = util.format('\'%s\'', hashes[url]);
                }
            }
        });
```