parse_chat: DRY it up a bit