Remove unneeded variable assignments