LPS-48728 (not for review) Refactor repository factories