refactor badges

Today I was working with badges. It did not really result in anything worth sharing, but these few changes fell of as a side effect. Two of these commits are fixes that I think we should merge. The other two may be a matter of taste and I won't be mad if you decide to throw them away.