Remove unnecessary if clauses