Refactor StatsClient