Restructured cleanup script