move things around to facilitate export
Fix clojure compiler errors