Remove unnecessary variable and `if` statement.