moved code to clj-utils