Use class attribute directly instead of using an intermediate variable
Validate badge on target of the action because the action can also impact him