Refactor the double extrusion heuristic for Gcode