Btw, what is the purpose of having this function and the serialize one below?

Why not doing just a `serialize` function?