serializing functions