Remove some not needed var in pivot function