refactored messages box