Clean up code and change notifications badge based on new events