Refactored the code: de-serializzation uses now default constuctor. A
contructor with a parameter is used for building ui objects.