clean redundant codes