extract publish func