Did some further optimizations