We prove upper bounds for the average size of the $$\ell $$
ℓ
-torsion $${{\,\mathrm{Cl}\,}}_K[\ell ]$$
Cl
K
[
ℓ
]
of the class group of K, as K runs through certain natural families of number fields and $$\ell $$
ℓ
is a positive integer. We refine a key argument, used in almost all results of this type, which links upper bounds for $${{\,\mathrm{Cl}\,}}_K[\ell ]$$
Cl
K
[
ℓ
]
to the existence of many primes splitting completely in K that are small compared to the discriminant of K. Our improvements are achieved through the introduction of a new family of specialised invariants of number fields to replace the discriminant in this argument, in conjunction with new counting results for these invariants. This leads to significantly improved upper bounds for the average and sometimes even higher moments of $${{\,\mathrm{Cl}\,}}_K[\ell ]$$
Cl
K
[
ℓ
]
for many families of number fields K considered in the literature, for example, for the families of all degree-d-fields for $$d\in \{2,3,4,5\}$$
d
∈
{
2
,
3
,
4
,
5
}
(and non-$$D_4$$
D
4
if $$d=4$$
d
=
4
). As an application of the case $$d=2$$
d
=
2
we obtain the best upper bounds for the number of $$D_p$$
D
p
-fields of bounded discriminant, for primes $$p>3$$
p
>
3
.