Use factory for detect repos