move context manipulation methods under private