config parsing refactoring