cleaned up destruction code