remove redundent code