Move statistic function to their own file and add as dependency