Update a setting
Refactor codes