Refactor method in scoring project