refine code, integrate op/do-publication and op/republish-all together