Reworked the method for extracting urls