Refactoring message js file for validation notification.