refactoring scraper