refine serialization codes