dom optimizations