Converted lots of pointers to stored objects, avoiding much new/delete code and eliminating memory leaks