Refactored the scoring