Make write/prepare private, clean up