extract database interaction to UrlRepository