relocate cassandra connection logic