QA-5437 : updated code according to review of BACKLOG-3757 ,  https://devtools.jahia.com/fisheye/cru/AND-175