rename repository class to RepositoryFactory
Fixed factories to be real factories