Some optimizations.