Refactor message box helper
Minor refactoring