some mem cleanups