better memory management for string tries