change some internal vars to buffer local