Some refactoring and the badge count updates as it should.
significant refactoring
Everything seems to work
All views seem to be working.
Significant refactoring and cleanup