more WIP, commit before refactoring to use a single context object.