Refactoring StatsService