Put cleanup code in some other places.