refs #9455. Refactoring to achieve better code reuse.