Refactoring the configuration parser; less complex, less duplication.