moved serialization stuff to own directory serialize