refactor the url parser and give a context class