Line optimization