Refactor the configuration validation.