Refactor all occurrences of messages to activities