Remove unnecessary rows.