Lot of optimizations