before and after cleanup