scraping refactorted