Rewrite cljs functions to js