various performance optimizations.