refactoring. move from clojurescript to javascript