private LocationFilterModel PrepareLocationFilters(IList<BaseProject> projects, Location location = null)
        {
            if (location == null)
            {
                var topLocations = _locationService.GetAllChildLocations();
                LocationFilterModel allRegionFilter;

                if (topLocations.Count > 1)
                {
                    allRegionFilter = new LocationFilterModel { Name = "All Regions", ProjectCount = projects.Count };
                    foreach (var topLocation in topLocations)
                        allRegionFilter.ChildrenLocations.Add(PrepareLocationFilters(projects.Where(p => p.Locations.Any(l => l.LocationId == topLocation.Id)).ToList(), topLocation));
                }
                else
                {
                    allRegionFilter = PrepareLocationFilters(projects, topLocations.First());
                }

                return allRegionFilter;
            }

            var locationFilter = location.ToFilterModel();
            locationFilter.Link = GetPageLink(location.SeoName, location.ParentLocation != null ? location.ParentLocation.SeoName : null).ToString();
            locationFilter.ProjectCount = projects.Count(p => p.Locations.Any(l => l.LocationId == location.Id));

            foreach (var child in location.ChildLocations)
            {
                int projectCount = projects.Count(p => p.Locations.Any(l => l.LocationId == child.Id));
                if (projectCount > 0)
                {
                    var childFilter = child.ToFilterModel();
                    childFilter.Link = GetPageLink(child.SeoName, child.ParentLocation != null ? child.ParentLocation.SeoName : null).ToString();
                    childFilter.ProjectCount = projectCount;
                    locationFilter.ChildrenLocations.Add(childFilter);
                }
            }

            var parentLocation = location.ParentLocation;
            while (parentLocation != null)
            {
                var parentLocationFilter = parentLocation.ToFilterModel();
                parentLocationFilter.ChildrenLocations.Add(locationFilter);
                parentLocationFilter.Link = GetPageLink(parentLocation.SeoName, parentLocation.ParentLocation != null ? parentLocation.ParentLocation.SeoName :  null).ToString();
                parentLocationFilter.ProjectCount = projects.Count(p => p.Locations.Any(l => l.LocationId == parentLocation.Id));

                locationFilter = parentLocationFilter;
                parentLocation = parentLocation.ParentLocation;
            }

            return locationFilter;
        }