speedups and cleanups for imperative searn