micro-optimizations and code reductions