privacyP: code refactoring of msg send