ENYO-2512: points of agreement with ENYO-2762 by refactoring code