refs #5054 some code improvements