simplify; fix erase() on already-erased
reorder key-handlers