Update copyright year.
Eliminate duplicated code.