Added the UrlGenerator as constructor argument