clean up: context encapsulation (preliminary)