add optimizations