remove all unnecessary lines