Rewrite default config files loading

use a loop for possible values, stack exceptions and return the first
one if no match after all.