refactoring url methods