DRYed up stat calculator