refine unit parsing