Separated serialization logic from model (will be better for deserialization)