scraping refactored