refactoring out SVG writer