Introduce badge abstraction and tests