Improved environment cleanup