 ;; Function calls
 ;;*********************************************************
 
-(defn ref->name [node]
-  (let [op (when (= (:kind node) :pipe)
-             (get-in @aurora-state [:notebooks (:notebook @aurora-state) :pages (-> node :id)]))]
-    (:desc op (or (:id node) (-> node :fn meta :desc)))))
+(defn ref->name [ref]
+  (let [op (when (= (:type ref) :ref/id)
+             (from-index (:id ref)))]
+    (if op
+      (:desc op (:id ref))
+      (-> (js/eval (:js ref)) meta :desc)
+      )))
 
 (defdom clickable-ref [step path]
-  (let [node (:node step)
-        name (ref->name node)
+  (let [ref (:ref step)
+        name (ref->name ref)
         dblclick (fn []
                 (swap! aurora-state update-in [:open-paths path] #(if (not %)
-                                                                    (:id node))))]
+                                                                    (:id ref))))]
     (dom
       [:p {:className "desc"
            :onDoubleClick dblclick}
        name
-       (each [input (:inputs step)]
+       (each [input (:args step)]
              [:span {:className "prev"} input])])))
 
-(defmethod step-list-item :ref [step path]
+(defmethod step-list-item :call [step path]
   (dom
    [:li {:className (step-class path)
          :onClick (step-click path)}

           [:span {:className "native"} "Native method"])])))


(defdom manual-steps [man path]
   [:ul {:className "steps"}
     (each [node (:nodes man)]
           (step-list-item node (update-path path {:step index
                                                   :step-var (:id node)}))
           )])

(defdom steps-workspace [man]
  [:div {:className (str "workspace" (when (:steps @aurora-state)
                                       " active"))}

   [:div {:className "steps-container"}
    (manual-steps man [{:notebook (:notebook @aurora-state)
                        :page (:page @aurora-state)}])]
     ])


;;*********************************************************

(defn match-pattern [x]
    (item-ui x))

(defn branch-result [branch path]
  (if (-> branch :node :type (= :ref))
