Refactoring: extract logic from tournament_chart view