Refactor the example producer2