Improved cleaning script.