         (loop [service-id->scaling-executor-chan initial-state]
           (recur
             (let [[data channel] (async/alts! [executor-multiplexer-chan query-chan] :priority true)]
-              (cond
-                (= channel executor-multiplexer-chan)
+              (condp = channel
+                executor-multiplexer-chan
                 (let [{:keys [service-id scale-amount correlation-id] :as scaling-data} data]
                   (cid/with-correlation-id
                     correlation-id

            (map (fn [service-id]
                   (let [outstanding-requests (or (service-id->outstanding-requests service-id) 0)
                         {:keys [healthy-instances expired-instances]} (service-id->router-state service-id)
                         {:keys [instances task-count]} (service-id->scheduler-state service-id)
                         ; if we don't have a target instance count, default to the number of tasks
                         target-instances (get-in service-id->scale-state [service-id :target-instances] task-count)
                         {:keys [target-instances scale-to-instances scale-amount]}

                          (log/info "shutting down scaling executor channel for" service-id)
                          (async/close! executor-chan)
                          (dissoc service-id->scaling-executor-chan service-id))))))

                query-chan
                (let [{:keys [response-chan service-id]} data]
                  (if service-id
                    (if-let [query-chan (get-in service-id->scaling-executor-chan [service-id :query-chan])]
