upgrade serialize and handler to parse relations