EVEN moar script cleanup and upgrade