More optimizations/speedups.