Refactoring code for Civic Score Rankings