Refactorize complex methods

IMHO, I notice that two last methods are too complex. I try to refactorize them.

PS: I add Code Climate badge [https://codeclimate.com/github/hexorx/countries]