Add structure to branch logic depending on msg type.