Refactored Config validation.