Replaced old implementation with one which should be unit testable

Refs #10092