minor optimizations

minor optimizations