    (let [config (merge (cassandra-config) options)]
      (->Cassandra config))))
 
-(defn cassandra-client
+(defn new-cassandra-client
   "Create an instance from cassandra component. This function is meant
   to be used with `hellhound.system.defsystem` macro."
   ([system-map]
-   (cassandra-client system-map {}))
+   (new-cassandra-client system-map {}))
   ([system-map options]
    (let [config (merge (cassandra-config) options)]
      (update-in system-map [:components :cassandra] (->Cassandra config)))))

(defn- check-session
  [session name]
  (if (nil? session)
    (throw (Exception. (format "'%s' component is not started yet." name)))))

(defrecord Cassandra [options]
  protocols/DatabaseLifecycle

  (start [this]
    (spec/valid? ::cassanda-configuration options)
    (logger/info "Connecting to Cassandra cluster...")
    (let [session   (connect options)
          keyspace  (:name (:keyspace options))]

      (try
        (alia/execute session (format "USE %s;" keyspace))
        (catch  com.datastax.driver.core.exceptions.InvalidQueryException e
          (throw (Exception. "Keyspace is not present. You need to migrate first."))))
      (assoc this :session session :keyspace keyspace)))

  (stop [this]
    (if (:session this)
      (do
        (logger/info "Disconnecting from Cassandra cluster...")
        (alia/shutdown (:session this))
        (dissoc this :session :keyspace :keyspace-selected))
      this))

  (setup [this]
    (let [session (:session this)]

   [environ.core                   :as environ]
   [qbits.alia                     :as alia]
   [qbits.hayt                     :as hayt]

   ;; Internals
   [hellhound.components.protocols :as protocols]
   [hellhound.logger.core          :as logger]
