fix bug of missing @Configuaration
extract PatchModelFactory2D and configs