various micro-optimizations