Optimize `#write` to use memcpy
Tweak the helper functions