cleaned up serialization