Refactor scraper write_data_for method