smarter way of getting the urls