Moved serialization rule to model