Did some more optimizations