refactor: extracted the Spare detection logic and reduced nesting in scoreAtFrame(frame)