Code refactoring and seperating the code that checks HW score and issues badges