Refactoring for DOM expression evaluator