improved destroy function, docblocks