Better cleanup logic.