Refactor stream URL parsers