switch to destructor pattern