local optimizations