remove unused variables from visit