refactoring in preparation for evaluating intermediate expressions