use url.parse - don't reinvent the wheel