Copy data only when necessary