simplify serialization.
improve constructor.