Performed various optimizations