Cleaned up repository manager/factory