Simplify some code, unify global/per-entity-type stat gathering