Score calculation refactoring.