Consolidate the function and just pass in the URI. #1439