cleanup and new version of fetch script