Refactoring key index for cassandra cql.

Problem with determining key index. Refactored key index.