added handling for high cardinality phrases