Badges refactoring