Further refactoring on the producer