remove unnecessary `if`