refactored message structure