Revert "Revert "Refs #9413 functions for duplicated code""

This reverts commit 1cd50932611de84ea24da2e57c383f1135812635.
Refs #9413 fix Windows build