config validation refactoring