Create helper macroses EVENT_WRITE and EVENT_WRITE_BULK
And use it instead safe_write and bulk_write