Converted curenv calls into an opaque macro