refactoring scraping