some cleanup and upgrades