Some simplifications to script