Remove duplicate code by using util::copy()

This code is identical to util::copy()