more optimizations/tuning