There is room for optimizing the handler's algorithm. See [here](https://github.com/sillsdev/machine/pull/306#pullrequestreview-2905856466). As applicable, these should also be ported back into machine.py.