Badge generation code integrated