We have around 150 scorers, one per practice game, each converting a finished game state into a score. They live under scoring/scorers/ and were written as self-contained units, which is the right shape: the scoring rules genuinely differ per game, and a shared base class would be a lie about how much they have in common. What they did have in common was arithmetic. Before this cleanup the codebase contained: 38 local definitions of clamp , in three mutually incompatible signatures ...