updated repository factory