Refactoring: common function set_sensitivity from toggle