Refine data structure