Refactored the Scoreboard js