refactored HitTestResponse handling of urls from elements into helper fn