Remove unnecessary if block