refactor vm definition.