Renamed instances of envelope to context