refactoring of deleteParamsFromURL