[vega]duplicate code