Remove duplicate code in append().