factoring Statistic class code