Refactor duplicate processing to the same variable

An intention becomes clear by unifying the duplicate processing to the same variable.