refactored (un)track setting into one function