optimized switch