lib/url: little refactor