optimized versions