Refactor score method