improve searching line functions