Remove global variables in transform