simplify code for lines