advanced optimizations tweaks