reduce conditionals in url_for