Issue #3260258 by mohit_aghera, larowlan: Refactor "getEntitiesToView" method of BackFillByTermsFormatter