Refactor pub plan.