NEW cleanup and more robust