Change the approach so that error checking is done inline with AutoFactoryDeclaration creation