improve data structures, and their memory management