remove redundant branches
remove redundant if/for duplications