         (assoc :enemy-funstruct (:funstruct (f/get-player-state game-state opponent-uuid))))))
 
 (defn send-game-updates [game-id]
-  (let [initialized-game (get-game (current-global-state) game-id)
+  (let [initialized-game (gs/get-game (gs/current-global-state) game-id)
         [p1 p2 :as players] (f/get-game-players initialized-game)
-        [c1 c2] (map #(channel-for-uuid (current-global-state) %) players)]
+        [c1 c2] (map #(gs/channel-for-uuid (gs/current-global-state) %) players)]
     (u/log "Sending game-update's for game " game-id)
     (send-command {:type :game-update
                     :data (make-update-data initialized-game p1)


(defmethod handle-command "game-request" [command channel]
  (let [uuid (u/gen-uuid)]
    (update-global-state (comp #(add-channel % channel uuid)
                               #(add-pending % uuid)))
    (u/log "Processing game-request and generating uuid: " uuid)
    (send-command {:type :game-request-ok
                    :data {:uuid uuid
                           :pending (get-pending-players (current-global-state))}}
                   channel
                   )))

(defmethod handle-command "start-game-ok" [command channel]
  (let [game-id (u/uuid-from-string (get-in command [:data :game-id]))
        game (get-game (current-global-state) game-id)
        player-id (uuid-for-channel (current-global-state) channel)
        ]
    (u/log "Processing start-game-ok for game: " game-id
           "\n\n")
    (update-global-state update-game game-id f/mark-player-ready player-id)
    (when (f/both-players-ready (get-game (current-global-state) game-id))
      (update-global-state update-game game-id f/init-game)
      (send-game-updates game-id))))

(defmethod handle-command "action" [command channel]
  (let [game-id (u/uuid-from-string (get-in command [:data :game-id]))
        player-id (uuid-for-channel (current-global-state) channel)
        card-idx (get-in command [:data :card-idx])
        target (get-in command [:data :target])
        funstr-idx (get-in command [:data :funstruct-idx])]
    (update-global-state update-game game-id f/use-card player-id card-idx funstr-idx)
    (send-game-updates game-id)))

(defmethod handle-command "end-turn" [command channel]
  (let [game-id (u/uuid-from-string (get-in command [:data :game-id]))
        player-id (uuid-for-channel (current-global-state) channel)]

    (u/log "Processing end-turn for game: " game-id)

    (update-global-state update-game game-id f/end-turn-for-player)
    (let [updated-game (get-game (current-global-state) game-id)]
      (when (f/turn-finished? updated-game)
        (update-global-state update-game game-id f/end-turn)
        (send-game-updates game-id)))))

(defmethod handle-command :default [command channel]
  (u/printerr "Unrecognized command: " command))

                               :enemy uuid1}}
                       channel2)

        (gs/update-global-state gs/add-game game-id (f/make-game uuid1 uuid2))
        (gs/update-global-state #(apply gs/remove-from-pending % pending-pair))))
    (recur)))

(defn make-update-data [game-state player-uuid]
