New version with cleanup and upgrades.