remove `flush macro, fold it into `cleanup