Removed some duplicated code

Refs #10266