Move required service to the constructor and create repository from factory