remove clj-json, extract function