Internals

merge the internals (which was already merged with the context) branch.