ECMS-5942: Error while displaying Sites Explorer without buttons

Fix description:
  - Remove duplicate code