Refactoring constructor of Line2d