Reorder conditions according to their frequency