Refactoring the way to update pages score