Add comments that say what these if statements are for. You could say that this deals with queries such as ..., and if that fails we use the country's name etc.