refactored scraping process