Moved serialization out of node