Trimming unneeded lines