Refactored ranking service