improved efficiency of destructor