Refactoring for reduced complexity. Changing how context works a bit.