c
finishing refactoring serialization