broke out publishing functionality into a separate class