cassandra lib refactor