Refactor out settings_set