Refactored to pass rubocop check (refs #342).