refactor cutlist code