Refactor svg_path for easier usage and less memory consumption