Reworked repository selection mechanism