refactoring badges