cleaned up publish functions