small refactor refs #3726
Fixing test