ENG-5684: refactor into base class and review comments.