     (update-role circle role-name assoc :purpose nil)
     (update-role circle role-name assoc :purpose new-purpose)))
 
-(def ^:private err-types {:domains          "Domain"
-                          :accountabilities "Accountability"
-                          :policies         "Policy"})
+(def ^:private sets-of-things {:domains          "Domain"
+                               :accountabilities "Accountability"
+                               :policies         "Policy"})
 
 (defn- validate-things
   "Abstract function to validate collections of things in a circle. Checks that

;; ## Generalization Functions ##

(defn- update-role-raw
  "Generalizes any role manipulation. The entity-path is the path to the entity
   inside the role you want to manipulate. The function given is what
   gets applied to the final entity, and the params are the arguments passed to
   that function."
  [circle role-name entities fn args]

  [circle role-name type thing check-fn err-msg-fmt]
  (validate-role-updates circle role-name)
  (validate-not (check-fn (get-entity circle role-name type) thing)
                (format err-msg-fmt (sets-of-things type) thing role-name)))

(defn is-lead-link? [role-name]
  (= lead-link-name role-name))

(defn- add-to
  "Abstract function that adds anything to a set-of-things in a role in a
   circle. Performs all validation and so forth. Creates the set if it doesn't
   exist. The sets that can be manipulated are defined in sets-of-things."
  [circle role-name set-of-things thing]
  (validate-not (is-lead-link? role-name)
                (format "May not add %s to '%s'"
                        (sets-of-things set-of-things) role-name))
  (validate-things circle role-name set-of-things thing contains?
                   "%s '%s' already exists on role '%s'")
  (let [things (get-entity circle role-name set-of-things)
        circle (if things
                 circle
                 (update-role circle role-name assoc set-of-things #{}))]
    (update-role-entity circle role-name [set-of-things] conj thing)))

(defn- remove-from
  "Abstract function that removes a thing from a set-of-things in a role in a
   circle. Performs all validation and so forth. Removes the set if it's empty."
  [circle role-name set-of-things thing]
  (validate-things circle role-name set-of-things thing (comp not contains?)
                   "%s '%s' doesn't exist on role '%s'")
  (remove-and-purge circle role-name set-of-things disj thing))

;; ## Role Collection Manipulation Functions ##
;; These functions are critical to maintaining namespace encapsulation. Simply
