Refactoring of some configfile methods