added url parsing helper
removed unnecessary code