separate global reference from env reference. separate appvar and app instruction