Made writeReplace more private