Improve password serialization