internal and external badge count update abstracted. code cleanup