   ([#^Model model #^Keyword attribute-key attribute-type attribute-value #^Metadata tgt-metadata]
    (let [strategy (make-sum-reducer-strategy attribute-key (.getMetadata model) tgt-metadata)
 	 view-name-fn #(str "sum(" % ")")
-	 reducer (make-reducer model attribute-key [attribute-value] strategy tgt-metadata view-name-fn)]
+	 reducer (make-reducer (.getName model) attribute-key [attribute-value] strategy tgt-metadata view-name-fn)]
      (connect model reducer)))
   )
 

(defn do-reduce-count [#^Model model #^Collection values #^Metadata tgt-metadata count-key]
  (let [strategy (make-count-reducer-strategy (.getMetadata model) tgt-metadata)
	view-name-fn (fn [arg] "count()")]
    (make-reducer model count-key values strategy tgt-metadata view-name-fn)))

;;----------------------------------------
;; refactored to here

;;----------------------------------------

(defn make-reducer
  [#^String name-prefix #^Object reduction-key #^Collection key-values #^Reducer$Strategy strategy #^Metadata tgt-metadata name-fn]
  (let [view-name (str name-prefix "." (name-fn reduction-key))]
    (Reducer. view-name tgt-metadata key-values strategy)))

;; sum specific stuff - should be in its own file
