Small code optimizations