Move env setting to exec context