more minor optimizations