For ENG-6067, based on Ning's feedback refactor copy pasta