refactor a small bit of code
refactor a small bit of code

Refs #14962

sapitts/moose,harterj/moose,SudiptaBiswas/moose,dschwen/moose,bwspenc/moose,lindsayad/moose,idaholab/moose,milljm/moose,dschwen/moose,laagesen/moose,jessecarterMOOSE/moose,SudiptaBiswas/moose,milljm/moose,laagesen/moose,andrsd/moose,dschwen/moose,SudiptaBiswas/moose,idaholab/moose,andrsd/moose,idaholab/moose,andrsd/moose,laagesen/moose,jessecarterMOOSE/moose,harterj/moose,nuclear-wizard/moose,andrsd/moose,dschwen/moose,idaholab/moose,milljm/moose,sapitts/moose,bwspenc/moose,SudiptaBiswas/moose,SudiptaBiswas/moose,sapitts/moose,milljm/moose,bwspenc/moose,nuclear-wizard/moose,harterj/moose,nuclear-wizard/moose,jessecarterMOOSE/moose,lindsayad/moose,andrsd/moose,laagesen/moose,bwspenc/moose,laagesen/moose,harterj/moose,jessecarterMOOSE/moose,lindsayad/moose,sapitts/moose,jessecarterMOOSE/moose,dschwen/moose,milljm/moose,nuclear-wizard/moose,idaholab/moose,lindsayad/moose,sapitts/moose,bwspenc/moose,harterj/moose,lindsayad/moose