Refactor code, eliminate code smell in score method