   "Substitutes for every defined concept name in tbox a new, globally
   unique, concept name and finally substitutes traget with its new name."
   [[tbox target]]
-  (let [symbols     (defined-concepts tbox)]
+  (let [symbols (defined-concepts tbox)]
     (when-not (some #(= target %) symbols)
       (illegal-argument "Target given to uniquify-ttp does not occur in the defined concepts of the given tbox."))
     (let [new-symbols (map-by-fn (fn [_] (gensym)) symbols)]
       [(make-tbox (tbox-language tbox)
-                  (into {} (for [[sym sym-def] (tbox-definition-map tbox)]
-                             [(new-symbols sym)
-                              (make-dl-definition (new-symbols sym)
-                                                  (substitute (definition-expression sym-def) new-symbols))])))
+                  (reduce! (fn [map [sym sym-def]]
+                             (assoc! map
+                                     (new-symbols sym)
+                                     (make-dl-definition (new-symbols sym)
+                                                         (substitute (definition-expression sym-def)
+                                                                     new-symbols))))
+                           {}
+                           (tbox-definition-map tbox)))
        (new-symbols target)])))
 
 (defn uniquify-tbox

  clarify-ttp (or reduce-ttp) afterwards to remove all unused
  definitions."
  [[tbox target]]
  (let [reversed-map (reduce (fn [hash-map definition]
			       (let [name (definition-target definition)]
				 (update-in hash-map [(expression-term (definition-expression definition))]
					    conj (definition-target definition))))
			     {}
			     (tbox-definitions tbox)),
	rename-map (into {} (for [definition (tbox-definitions tbox)]
			      [(definition-target definition),
			       (first (sort (reversed-map (expression-term (definition-expression definition)))))])),
	new-tbox (make-tbox (tbox-language tbox)
			    (into {} (for [definition (tbox-definitions tbox)]
                                       [(definition-target definition)
                                        (make-dl-definition (tbox-language tbox)
                                                            (definition-target definition)
                                                            (substitute (definition-expression definition) rename-map))])))]
    (if (not= tbox new-tbox)
      (tidy-up-ttp [new-tbox target])
      [tbox target])))

(defn collect-targets
  "Collects all targets reachable in the usage graph of tbox, starting
  from targets."
  [tbox targets seen]

  [[tbox target]]
  (let [needed-targets (collect-targets tbox #{target} #{}),
	new-tbox       (make-tbox (tbox-language tbox)
                                  (select-keys (tbox-definition-map tbox)
                                               needed-targets))]
    [new-tbox target]))

(defn expand-ttp
