vec2d: refactoring in progress