remove unnecessary condition
remove dead code