Small refactoring of PlanContext and surrounding classes
Merge pull request #2449 from systay/plancontext-tweak

Small refactoring of PlanContext and surrounding classes