Improvement of "getAvailableCountries" function