move assignment to only case that uses var.