improved urlFor method (still WIP)