[cfid-674] Clean up YAML validation and make a FactoryBean

[#46077585]