refactoring cljs, maintaining functionality