Implemented extractURLs and done some other refactorings