              (assoc socket-user :color (:player/color player)))
 
       ;; Sends the current game frame to the frontend
-      ((send-arena arena) chan-id)
+      (send-message chan-id
+                    (m/arena-message arena))
 
       ;; Sends the stats (player info)
-      ((send-stats (get-player-stats game-state)) chan-id)
-
+      (send-message chan-id
+                    (m/stats-message (get-player-stats game-state)))
 
       ;; Sends the game info to the front end
-      ((send-game-info game) chan-id))))
+      (send-message chan-id
+                    (m/game-info-message game)))))
 
 (defn- leave-game
   [_]

                               :color (get-player-color game-id chan-id)
                               :timestamp (str (l/local-now))}]
        (broadcast-to-viewers game-id
                              (send-chat-message game-id formatted-message))))))

(defn create-socket-handler-map
  "Allows for adding custom handlers that respond to namespaced messages

;; Broadcast helper functions

(defn- broadcast-to-viewers
  [game-id message]
  (let [channel-ids (get-game-room-channel-ids game-id)]
    (doseq [channel-id channel-ids]
      (send-message channel-id message))))

;; Broadcast/send functions

(defn broadcast-arena
  [game-id arena]
  (broadcast-to-viewers game-id
                        (m/arena-message arena)))

(defn broadcast-stats
  [game-id stats]
  (broadcast-to-viewers game-id
                        (m/stats-message stats)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Handlers
