public static async Task <FortData> GetNextPokeStop(ISession session)
        {
            var priorityTarget = await SetMoveToTargetTask.GetTarget(session);

            if (priorityTarget != null)
            {
                return(priorityTarget);
            }


            if (session.Forts == null ||
                session.Forts.Count == 0 ||
                session.Forts.Count(p => p.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime()) == 0)
            {
                //TODO : A logic need to be add for handle this  case?
            }
            ;

            var deployedPokemons = session.Inventory.GetDeployedPokemons();

            //NOTE : This code is killing perfomance of BOT if GYM is turn on, need to refactor to avoid this hummer call API

            var forts = session.Forts
                        .Where(p => p.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime())
                        .Where(f => f.Type == FortType.Checkpoint ||
                               (session.LogicSettings.GymConfig.Enable && (
                                    UseGymBattleTask.CanAttackGym(session, f, deployedPokemons) ||
                                    UseGymBattleTask.CanTrainGym(session, f, deployedPokemons) ||
                                    UseGymBattleTask.CanDeployToGym(session, f, deployedPokemons))))
                        .ToList();

            if (session.LogicSettings.GymConfig.Enable &&
                ((session.LogicSettings.GymConfig.EnableAttackGym && forts.Where(w => w.Type == FortType.Gym && UseGymBattleTask.CanAttackGym(session, w, deployedPokemons)).Count() == 0) ||
                 (session.LogicSettings.GymConfig.EnableGymTraining && forts.Where(w => w.Type == FortType.Gym && UseGymBattleTask.CanTrainGym(session, w, deployedPokemons)).Count() == 0)
                ))
            {
                //Logger.Write("No usable gym found. Trying to refresh list.", LogLevel.Gym, ConsoleColor.Magenta);
                await GetPokeStops(session);
            }

            forts = forts.OrderBy(
                p =>
                session.Navigation.WalkStrategy.CalculateDistance(
                    session.Client.CurrentLatitude,
                    session.Client.CurrentLongitude,
                    p.Latitude,
                    p.Longitude,
                    session)
                ).ToList();

            if (session.LogicSettings.UseGpxPathing)
            {
                forts = forts.Where(p => LocationUtils.CalculateDistanceInMeters(p.Latitude, p.Longitude, session.Client.CurrentLatitude, session.Client.CurrentLongitude) < 40).ToList();
            }

            var reviveCount = session.Inventory.GetItems().Where(w => w.ItemId == POGOProtos.Inventory.Item.ItemId.ItemRevive || w.ItemId == POGOProtos.Inventory.Item.ItemId.ItemMaxRevive).Select(s => s.Count).Sum();

            if (!session.LogicSettings.GymConfig.Enable ||
                session.LogicSettings.GymConfig.MinRevivePotions > reviveCount
                /*|| session.Inventory.GetPlayerStats().FirstOrDefault().Level <= 5*/
                )
            {
                // Filter out the gyms
                forts = forts.Where(x => x.Type != FortType.Gym).ToList();
            }
            else if (session.LogicSettings.GymConfig.PrioritizeGymOverPokestop)
            {
                // Prioritize gyms over pokestops
                var gyms = forts.Where(x => x.Type == FortType.Gym &&
                                       LocationUtils.CalculateDistanceInMeters(x.Latitude, x.Longitude, session.Client.CurrentLatitude, session.Client.CurrentLongitude) < session.LogicSettings.GymConfig.MaxDistance);
                //.OrderBy(x => LocationUtils.CalculateDistanceInMeters(x.Latitude, x.Longitude, session.Client.CurrentLatitude, session.Client.CurrentLongitude));

                if (session.LogicSettings.GymConfig.PrioritizeGymWithFreeSlot)
                {
                    var freeSlots = gyms.Where(w => w.OwnedByTeam == session.Profile.PlayerData.Team && UseGymBattleTask.CanDeployToGym(session, w, deployedPokemons));
                    if (freeSlots.Count() > 0)
                    {
                        return(freeSlots.First());
                    }
                }

                // Return the first gym in range.
                if (gyms.Count() > 0)
                {
                    return(gyms.FirstOrDefault());
                }
            }

            return(forts.FirstOrDefault());
        }