simplify parse_url implementation.