Clean up Context and split it out.