Refactoring the removeIssuesHavingLabels method