Small refactoring in code for display publish confirmation dialog