Optimizations and fine tuning