Updating generic extract script to use new code