removing unneeded lines from retrieval queries