clojure rewrite of ilcdb