Better cleanup method.