Refine strings