Lots of optimizations and moving things around.