support events and more natural copy_buffer api