refine code struct