Script management and clean-up