Refactoring StatisticsTool class