smarter building of URIs