refactoring calculate user score