Optimize the message handling from local notification