refactor and scoring