refractoing code