refactoring url checking,