added some more logic to badge parser