refactor, there might be memory leak related to VtoG