Refactor partial evaluator