Remove unneeded variables from context