some cljs refactoring (not complete...)