script input/output cleanup