ENG-5616 partly backout bad refactor