You actually don't need `cookie-policy` at all, so you could do:

```clojure
(when cookie-spec-factory
       (-> http-client
         .getCookieSpecs
         (.register (str (type cookie-spec-factory)), cookie-spec-factory)))
```

And then further down:

```clojure
(set-client-param ClientPNames/COOKIE_POLICY
                  (if cookie-spec-factory
                    (str (type cookie-spec-factory))
                    CookiePolicy/BROWSER_COMPATIBILITY)
```