moved scraping to own function