Can we add all this block (that will assign the user into the group with 'no'  membershipType) after this one:
---------
        if (broadcast) {
            preSave(membership, true);
        }
--------