refactaring for topic of publish