Add some optimizations.