better handling of keys not being in the data structure