This variable itself doesn't need to be scoped to the whole file.  Define the trimmedStabilizationDesired variable within the task function