split context into global and local, more tests