Added optimizations