Refactored common data queries into immutable TeamStatsRepository. Added filtering by spec.