rule code refine