Removing unnecessary lines