minor speedup tweaks