remove redundant "if"