Improved generality of URL construction