code refactoring and minor message notification change