Rather than recreating the QMMMD object in so many branches, I would suggest bringing forward the tests for roles that don't need the data to before it gets created, then continuing as before if the role is not among those ones.