Improve target URL generator