moved the url manipulate functions to a separate js moduule