Removal of unnecessary lines