refine and fix