improved script removal