several code simplifications and optimizations around the new curves feature.