tidy up context creation