Export to SVG: refactoring