refine code 1