Implement callbacks for gcode generation