Refactored custom badge logic in RootCell