- moved serialization code in own file