Simplify code to get redirected url address