some code cleanup and scoreboard