move some custom statistic function to statistic.go