refactoring events set badge