a few more minor optimizations

additional globals copied to locals