Added code to ensure each model has an active and valid factory behind it.