Refactored.
Tests are successful for Cassandra, DynamoDb and Hypertable.