moved analyze code completely out of scraper