ENYO-2970: optimize regexps and remove unnecessary code