Refactoring TestLine2d