Repository:: improve discover(...) code
Reference:: add resolve(...)