Even more optimizations, but still not good enough.