master_cleanup