refs #8428. Move cleanup to separate method.