Moved url-construction to separate function

URL-construction was done same way in all four methods so I moved to a separate function.