allow proper removal of nodes, optimize storage and querying
layers, and cleanup the library