enhance groups statistics function