badges and refactor