Cleanup instance code