optimized code for countryActivity