Remove unnecessary variable assignments