Extract a stats utility method.