refactored messages to keys to avoid confusion