Consider DRYing this out with a nested function like
```
function makeUrl() {
    return _urlTemplate({
        originalUrl: originalUrl,
        filterQueryArgumentName: filterQueryArgumentName,
        uriEncodedFilterObject: uriEncodeFilterObject(filter)
    });
}
```