Refactor badges