Restructure serialization