Move function dependent resetting of a subtarget variable out of the