Code format and replaced hand-written copy by io.Copy