Refactoring of config parsing.