Change graph internal representation to minimize TVar count