most of electric factory scraper plus some refactoring