refine data structure