Added upgrade code and rendering expired badges