Move cql stuff to adapter