Removed useless while/switch/case from parseUrl