refactored retrieving URL