Improving the settings function