refactor Ranking