      ;; key property exists
      (not (nil? key-property-value))
      (if parent
-         (KeyFactory/createKey (get-key-object parent) datastore-entity-name key-property-value)
-         (KeyFactory/createKey datastore-entity-name key-property-value))
+         (KeyFactory/createKey (get-key-object parent) kind key-property-value)
+         (KeyFactory/createKey kind key-property-value))
      ;; something's wrong
      :else (throw (RuntimeException.
                    "entity has no valid :key metadata, and has no fields marked :key")))))
 
 
-(defn save!-helper [entity-record datastore-entity-name &
+(defn save!-helper [entity-record kind &
                     {:keys [parent]}]
   (let [key-object (if parent
                        (get-key-object entity-record parent)
                        (get-key-object entity-record))
         entity (if key-object
                    (Entity. key-object)
-                   (Entity. datastore-entity-name))]
+                   (Entity. kind))]
     (doseq [[property-kw value] entity-record]
       (let [property-name (.substring (str property-kw) 1)]
         (.setProperty entity property-name (coerce-clojure-type value))))

         :else v)))


(defn get-key-object-helper [entity-record key-property datastore-entity-name &
                             {:keys [parent]}]
  (let [entity-record-metadata (meta entity-record)
        metadata-key-value (when entity-record-metadata (:key entity-record-metadata))



(defn retrieve [entity-record-type key-value &
                {:keys [parent kind]
                 :or {kind (unqualified-name (.getName entity-record-type))}}]
  (let [key-object (if parent
                       (KeyFactory/createKey (get-key-object parent)
                                             kind
                                             (coerce-key-value-type key-value))
                       (KeyFactory/createKey kind
                                             (coerce-key-value-type key-value)))
        entity (.get (get-datastore-service) key-object)
        raw-properties (into {} (.getProperties entity))
