1) fixed bug with serialization of arrays
2) refactored architecture: use abstract factories
add forgotten in the previous commit files