improve the serialization of custom user models