Move publish() functionality to a reuseable Publisher class