last set of optimizations