Optimizations, and a lot more