remove unnecessary arraycopy