First step of refactoring, TODO check RepositoryFactory path