Refactory of settings module