refactor fields to match spec
handle repeated invites in a cleaner way (which does not crash when there are no new invites)