Made some setting cache optimizations.