Even more refactoring of Extrnal IP retrevial

Removed redudant uri import, made more compact.