extract function copy_bytes
call yield.get_one with rvalues because that is possible now
dereference an optional in a central place