(PE-2329) address issues from code review

* remove unnecessary test util fn
* use more specific exception when plugin system detects a duplicate
  file