Move instantiation logic of the repository to production code