removed segment2D, minor refactorings