Simplify the logic for building up chaine lines.