optimized calculations