Generating a reducer