public ActionResult Index()
        {
            VoteStatsViewModel viewModel = new VoteStatsViewModel();

            var allVotes = _repo.FindAllVotes();
            var allPlayers = _repo.FindAllPlayers();

            var meaningfulVotes = allVotes.Where(v => !v.IsUnvote);
            var meaningfulVoteGroups = meaningfulVotes.GroupBy(v => new { v.Voter, v.Recipient, v.Day });
            var votes = meaningfulVoteGroups.Select(g => g.First());

            CalculateTotalStats(viewModel, votes, allPlayers);

            viewModel.IndividualVoteStats = CalculateIndividualStats(votes, allPlayers);

            viewModel.FactionVoteStats = CalculateFactionStats(votes, allPlayers);

            return View(viewModel);
        }
        private static void CalculateTotalStats(VoteStatsViewModel viewModel, IEnumerable<Vote> votes, IEnumerable<Player> allPlayers)
        {
            viewModel.NumberOfVotes = votes.Count();
            viewModel.PercentageOfVotesOntoMafia =
                VoteAnalyser.CalculatePercentage(votes, (v) => v.TargetAllegiance == Allegiance.Mafia, allPlayers);

            viewModel.PercentageOfVotesOntoTown =
                VoteAnalyser.CalculatePercentage(votes, (v) => v.TargetAllegiance == Allegiance.Town, allPlayers);

            viewModel.PercentageOfVotesOntoNonTown =
                VoteAnalyser.CalculatePercentage(votes, (v) => v.TargetAllegiance != Allegiance.Town, allPlayers);
        }