Factor out chained productions into a method so we can change parameters easily.