Made a bunch of brilliant, just brilliant, optimizations