       (filter (fn [{:keys [name]}] (= name default-league-name)))
       first))
 
-(defn- ensure-atleast-one-league-exists [conn]
+(defn- ensure-atleast-one-league-exists
+  "Create a default league if one does not exist"
+  [conn]
   (let [dbc         (db conn)
         leagues     (get-leagues dbc)
         no-leagues? (empty? leagues)]
-    (info {:ensure-atleast-one-league-exists no-leagues?})
     (when no-leagues?
-      (info "creating league:" default-league-name)
+      (info "Creating default league:" default-league-name)
       @(d/transact conn [{:db/id (d/tempid :db.part/user) :league/name default-league-name}]))))
 
-(defn- ensure-all-players-have-atleast-one-league [conn]
+(defn- ensure-all-players-have-atleast-one-league
+  "Ensure that every player is in a league"
+  [conn]
   (let [dbc                      (db conn)
         default-league           (get-default-league dbc)
         players-with-names       (->> (d/q '[:find ?pid :where [?pid :player/name _]] dbc)

                                set)
        players-to-default (difference players-with-names players-with-roles)
        transaction        (map (fn [id] {:db/id id :user/role :user}) players-to-default)]
    (info {:ensure-players-users-have-roles transaction})
    @(d/transact conn transaction)))

(defn- get-leagues [dbc]

        players-to-give-a-league (difference players-with-names players-with-leagues)
        transaction              (map (fn [pid] {:db/id pid :player/leagues (:id  default-league)})
                                      players-to-give-a-league)]
    (info "Players changed:" (count players-to-give-a-league))
    @(d/transact conn transaction)))

(defn- ensure-all-matches-happened-in-a-league
  "Ensure that all matches have been played in a league"
  [conn]
  (let [dbc                      (db conn)
        default-league           (get-default-league dbc)
        matches-played           (->> (d/q '[:find ?mid :where [?mid :match/time _]] dbc)
