more minor cleanups
more minor cleanups
simplify more, move behind flag