LPS-46842 move all repository initialization code into the new factories