Refine db