ENG-6374: refactor for ENG-6374