make scoring functionality follow DRY principle