     (.close alia-session)))
 
 (defnk create-session
-  [contact-points datacenter keyspace {port nil}]
+  [contact-points datacenter keyspace :as args]
   (->AliaSession
    keyspace
-   (create-alia-session* contact-points datacenter keyspace port)))
+   (create-alia-session* args)))
 
 (defn mutated-tables
   [spy-session]

  [alia-session statement opts]
  (aliam/execute-buffered
   alia-session
   (if (string? statement)
     statement
     (do
       (when debug
         (prn statement))
       (h/->raw statement)))
   opts))

(defn- create-alia-session*
  [contact-points
   datacenter
   keyspace
   port]
  (let [cluster (alia/cluster
                 (assoc-when
                  {:contact-points contact-points}
                  :load-balancing-policy (when datacenter
                                           (lb/dc-aware-round-robin-policy
                                            datacenter))
                  :port port))
        alia-session (alia/connect cluster)]
    (alia/execute alia-session (str "USE " keyspace ";"))
    alia-session))

(ns er-cassandra.session.alia
  (:require
   [plumbing.core :refer :all]
   [taoensso.timbre :refer [trace debug info warn error]]
   [clojure.string :as str]
   [qbits.alia :as alia]
   [qbits.alia.policy.load-balancing :as lb]
