Some memory optimizations.