Massive speed optimizations.