simplify nil handling in UrlHelpers