 (defonce world-ref
   (atom (Registry. {} {})))
 
-(defn- obj->anchors []
+(defn- obj->anchors [obj]
   (let [^Registry world @world-ref]
-    (.obj->anchors world)))
+    (get (.obj->anchors world) x)))
 
-(defn- anchor->obj []
+(defn- anchor->obj [anchor]
   (let [^Registry world @world-ref]
-    (.anchor->obj world)))
+    (get (.anchor->obj world) anchor)))
 
 (defn gc []
   (swap! world-ref

  [{:keys [name kw init update]
    :as init-spec}]
  (let [anchor kw]
    (-> (or (when-let [x (get (anchor->obj) anchor)]
              (if (null-obj? x)
                (do (gc) ;; there shouldn't be any of these
                    nil)

         (defn ~name
           ([] (~name @world-ref))
           ([^timsg.scene_var.types.Registry world#]
            (when-let [^SceneVarAnchor sva# (obj-nil (anchor->obj ~kw))]
              (.gameObject sva#)))))))
