Several optimizations.