Let Q be a finite set of generalized quantifiers. By (Q) we denote the k-variable fragment of FO(Q), first order logic extended with Q. We show that for each k, there is a PFP(Q)-definable linear pre-order whose equivalence classes in any finite structure A are (Q)-types in A. For some special classes of generalized quantifiers Q, we show that such an ordering (Q)-types is already definable in IFP(Q). As applications of the above results, we prove some generalizations of the Abiteboul-Vianu theorem. For instance, we show that for any finite set Q of modular counting quantifiers, P = PSPACE if, and only if, IFP(Q) = PFP(Q) over finite structures