ENYO-2788: Refactoring as demanded in the pull request remarks.