Refactor the Leaderboard capture code