Better Optimizations

From CarbonDev and VanirAOSP