NB scala model and serialization