This seems fragile, is this the right way to construct this URL?