improve publish mechanism