                                                       scheduler-state-chan router-chan router-id exit-chan service-id->service-description-fn deployment-error-config)]
                                 {:exit-chan exit-chan
                                  :maintainer-chans maintainer-chan}))
-   :scheduler-broken-services-gc (pc/fnk [[:curator leader?-fn read-gc-state-fn write-gc-state-fn]
+   :scheduler-broken-services-gc (pc/fnk [[:curator gc-state-reader-fn gc-state-writer-fn leader?-fn]
                                           [:settings scheduler-gc-config]
                                           [:state clock scheduler]
                                           scheduler-maintainer]
                                    (let [scheduler-state-chan (async/tap (:scheduler-state-mult-chan scheduler-maintainer) (au/latest-chan))
-                                         service-gc-go-routine (partial service-gc-go-routine read-gc-state-fn write-gc-state-fn leader?-fn clock)]
+                                         service-gc-go-routine (partial service-gc-go-routine gc-state-reader-fn gc-state-writer-fn leader?-fn clock)]
                                      (scheduler/scheduler-broken-services-gc scheduler scheduler-state-chan scheduler-gc-config service-gc-go-routine)))
    :scheduler-maintainer (pc/fnk [[:routines service-id->service-description-fn]
                                   [:settings [:health-check-config health-check-timeout-ms failed-check-threshold] scheduler-syncer-interval-secs]

                (discovery/register router-id curator name (str base-path "/" discovery-relative-path) {:host host :port port}))
   :gc-base-path (pc/fnk [[:settings [:zookeeper base-path gc-relative-path]]]
                   (str base-path "/" gc-relative-path))
   :kv-store (pc/fnk [[:settings [:zookeeper base-path] kv-config]
                      [:state passwords]
                      curator]

                       latch (LeaderLatch. curator leader-latch-path router-id)
                       has-leadership? #(.hasLeadership latch)]
                   (.start latch)
                   (leader-fn-factory router-id has-leadership? discovery min-routers)))})

(def routines
  {:allowed-to-manage-service?-fn (pc/fnk [[:curator kv-store]
